package com.gwcm.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.gwcm.model.dto.role.RoleQueryRequest;
import com.gwcm.model.entity.Role;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gwcm.model.vo.RoleVo;

import java.util.List;

/**
* @author 15375
* @description 针对表【role(角色表)】的数据库操作Service
* @createDate 2023-03-21 16:40:11
*/
public interface IRoleService extends IService<Role> {
    /**
     * 根据用户名查询角色
     * @param username
     * @return
     */
    List<String> getRolesByUserName(String username);

    boolean attachRoleByUserId(Long roleId, Long userId);
    /**
     * 根据id查询role
     *
     * @param roleId
     * @return
     */
    RoleVo selectRoleById(Long roleId);

    /**
     * 查询role列表
     * @param role
     * @return
     */
    List<Role> selectRoleList(Role role);

    /**
     * 删除角色
     * @param roleId
     * @return
     */
    int deleteRoleById(Long roleId);

    void saveRole(Role role);

    /**
     * 更新角色
     * @param role
     * @return
     */
    void updateRole(Role role);

    IPage<RoleVo> pageList(RoleQueryRequest roleQueryRequest);
    void insertRoleMenu(Long roleId, Long[] menuIds);
    void insertRoleAuth(Long roleId, Long[] menuIds);
}
